<?php
class MOrders extends spModel{
	public $table = 'orders';
	public $pk = 'id';
		
	public function getAttributes(){
		return array(
			'good_name'=>'订单名',
			'good_num'=>'数量',
			'receiver_name'=>'收货人',
			'tel'=>'电话',
			//'phone'=>'手机',
			//'qq'=>'qq',
			'address'=>'收货地址',
			//'email'=>'Email',
			//'code'=>'邮编',
			'comments'=>'备注',
			);
	}
	
	//index显示的字段
	public function getUnFilteAttributes(){
		return array(
			'order_id'=>'订单号',
			'good_name'=>'商品名称',
			'receiver_name'=>'收货人',
			'tel'=>'电话',
			'address'=>'收货地址',
			'order_time'=>'订单时间',
			'status'=>'订单状态',
			);
	}

	//新增更新页面的字段
	public function getDetailAttributes(){
		return array(
			'order_id'=>'订单号',
			'good_name'=>'订单名',
			'status'=>'状态',
			'good_num'=>'数量',
			'order_time'=>'下单时间',
			'receiver_name'=>'收货人',
			'tel'=>'电话',
			'phone'=>'手机',
			'qq'=>'qq',
			'address'=>'收货地址',
			'email'=>'Email',
			'code'=>'邮编',
			'comments'=>'描述',
			'delivery_time'=>'发货时间',		
			);
	}
	
	public function getAttributeFormsets(){
		return array(
			'order_id'=>array('type'=>'textField', 'htmlOptions'=>array()),
			'good_name'=>array('type'=>'textField', 'htmlOptions'=>array()),
			'receiver_name'=>array('type'=>'textField', 'htmlOptions'=>array()),
			'comments'=>array('type'=>'textArea', 'htmlOptions'=>array('rows'=>'6')),
			//0=未处理，1=电话已确认，2=电话不通，3=取消订购，4=已发货，5=已退货, 6=已签收
			'status'=>array('type'=>'dropDownList', 'options'=>array('0'=>'全部','7'=>'未处理','1'=>'电话已确认','2'=>'电话不通','3'=>'取消订购','4'=>'已发货','5'=>'已退货','6'=>'已签收')),
			'pay_online'=>array('type'=>'radio', 'options'=>array('1'=>'线上支付','2'=>'货到付款')),
			'log'=>array('type'=>'textArea', 'htmlOptions'=>array('rows'=>'6')),		
			'good_num'=>array('type'=>'dropDownList', 'options'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','10'=>'10'), 'htmlOptions'=>array()),
            'delivery_time'=>array('type'=>'textField', 'htmlOptions'=>array('onFocus' => 'WdatePicker({isShowClear:false,readOnly:true,dateFmt:\'yyyy-MM-dd HH:mm:ss\'})')),
		);
	}
}